package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.util.List;


/**
 * The persistent class for the CERTIFICATE_TYPE database table.
 * 
 */
@Entity
@Table(name="CERTIFICATE_TYPE")
@NamedQuery(name="CertificateType.findAll", query="SELECT c FROM CertificateType c")
public class CertificateType implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="CERTIFICATE_TYPE_CERTYPEID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CERTIFICATE_TYPE_CERTYPEID_GENERATOR")
	@Column(name="CERTYPE_ID")
	private long certypeId;

	@Column(name="CERTYPE_NAME")
	private String certypeName;

	@Column(name="CERTYPE_REMARK")
	private String certypeRemark;

	@Column(name="HAS_SEVERAL")
	private BigDecimal hasSeveral;

	@Column(name="MIN_DEMAND")
	private BigDecimal minDemand;

	//bi-directional many-to-one association to ZszlType
	@OneToMany(mappedBy="certificateType")
	@JSONField(serialize = false)
	private List<ZszlType> zszlType;

	public CertificateType() {
	}

	public long getCertypeId() {
		return this.certypeId;
	}

	public void setCertypeId(long certypeId) {
		this.certypeId = certypeId;
	}

	public String getCertypeName() {
		return this.certypeName;
	}

	public void setCertypeName(String certypeName) {
		this.certypeName = certypeName;
	}

	public String getCertypeRemark() {
		return this.certypeRemark;
	}

	public void setCertypeRemark(String certypeRemark) {
		this.certypeRemark = certypeRemark;
	}

	public BigDecimal getHasSeveral() {
		return this.hasSeveral;
	}

	public void setHasSeveral(BigDecimal hasSeveral) {
		this.hasSeveral = hasSeveral;
	}

	public BigDecimal getMinDemand() {
		return this.minDemand;
	}

	public void setMinDemand(BigDecimal minDemand) {
		this.minDemand = minDemand;
	}

	public List<ZszlType> getZszlTypes() {
		return this.zszlType;
	}

	public void setZszlTypes(List<ZszlType> zszlTypes) {
		this.zszlType = zszlTypes;
	}

	public ZszlType addZszlType(ZszlType zszlType) {
		getZszlTypes().add(zszlType);
		zszlType.setCertificateType(this);

		return zszlType;
	}

	public ZszlType removeZszlType(ZszlType zszlType) {
		getZszlTypes().remove(zszlType);
		zszlType.setCertificateType(null);

		return zszlType;
	}

}